[gdk] Remove GdkWindowObject public structure
authorJavier Jardón <jjardon@gnome.org>
Fri, 25 Jun 2010 01:02:20 +0000 (03:02 +0200)
committerJavier Jardón <jjardon@gnome.org>
Thu, 1 Jul 2010 00:26:34 +0000 (02:26 +0200)
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=622677

docs/reference/gdk/gdk3-sections.txt
gdk/gdkinternals.h
gdk/gdkwindow.h
gtk/gtktestutils.c
tests/testwindows.c

index b253eaeeb26f8b9c8eb06bf63fc1a2d083407c1a..7c5a049f3adfa3a6aa8f4de7353292588d00d987 100644 (file)
@@ -726,7 +726,6 @@ gdk_window_get_effective_toplevel
 <SUBSECTION Standard>
 GDK_WINDOW
 GDK_WINDOW_GET_CLASS
-GDK_WINDOW_OBJECT
 GDK_TYPE_WINDOW
 GDK_IS_WINDOW
 GDK_WINDOW_CLASS
index becfb156768b177a5b620c4af68c0bcbcfff41a4..4e2b074de64d70082181fe43fe827d2b026ee67b 100644 (file)
@@ -188,9 +188,10 @@ typedef void (* GdkDisplayPointerInfoForeach) (GdkDisplay           *display,
    is public for historical reasons. Don't change that part */
 typedef struct _GdkWindowPaint             GdkWindowPaint;
 
+#define GDK_WINDOW_OBJECT(object)    ((GdkWindowObject *) GDK_WINDOW (object))
+
 struct _GdkWindowObject
 {
-  /* vvvvvvv THIS PART IS PUBLIC. DON'T CHANGE vvvvvvvvvvvvvv */
   GdkDrawable parent_instance;
 
   GdkDrawable *impl; /* window-system-specific delegate object */  
@@ -239,8 +240,6 @@ struct _GdkWindowObject
 
   GdkWindowRedirect *redirect;
 
-  /* ^^^^^^^^^^ THIS PART IS PUBLIC. DON'T CHANGE ^^^^^^^^^^ */
-  
   /* The GdkWindowObject that has the impl, ref:ed if another window.
    * This ref is required to keep the wrapper of the impl window alive
    * for as long as any GdkWindow references the impl. */
index 1e15438c7158e382ac30d879b84b3df062aec1ba..cdc250043ca8c653a5a72b061f0669b2e33cd97b 100644 (file)
@@ -491,68 +491,6 @@ typedef struct _GdkWindowObjectClass GdkWindowObjectClass;
 #define GDK_IS_WINDOW_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW))
 #define GDK_WINDOW_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW, GdkWindowObjectClass))
 
-#ifndef GDK_DISABLE_DEPRECATED
-#define GDK_WINDOW_OBJECT(object)    ((GdkWindowObject *) GDK_WINDOW (object))
-
-#ifndef GDK_COMPILATION
-
-/* We used to export all of GdkWindowObject, but we don't want to keep doing so.
-   However, there are various parts of it accessed by macros and other code,
-   so we keep the old exported version public, but in reality it is larger. */
-
-/**** DON'T CHANGE THIS STRUCT, the real version is in gdkinternals.h ****/
-struct _GdkWindowObject
-{
-  GdkDrawable parent_instance;
-
-  GdkDrawable *GSEAL (impl); /* window-system-specific delegate object */
-  
-  GdkWindowObject *GSEAL (parent);
-
-  gpointer GSEAL (user_data);
-
-  gint GSEAL (x);
-  gint GSEAL (y);
-  
-  gint GSEAL (extension_events);
-
-  GList *GSEAL (filters);
-  GList *GSEAL (children);
-
-  GdkColor GSEAL (bg_color);
-  GdkPixmap *GSEAL (bg_pixmap);
-  
-  GSList *GSEAL (paint_stack);
-  
-  cairo_region_t *GSEAL (update_area);
-  guint GSEAL (update_freeze_count);
-  
-  guint8 GSEAL (window_type);
-  guint8 GSEAL (depth);
-  guint8 GSEAL (resize_count);
-
-  GdkWindowState GSEAL (state);
-  
-  guint GSEAL (guffaw_gravity) : 1;
-  guint GSEAL (input_only) : 1;
-  guint GSEAL (modal_hint) : 1;
-  guint GSEAL (composited) : 1;
-  
-  guint GSEAL (destroyed) : 2;
-
-  guint GSEAL (accept_focus) : 1;
-  guint GSEAL (focus_on_map) : 1;
-  guint GSEAL (shaped) : 1;
-  guint GSEAL (support_multidevice) : 1;
-  
-  GdkEventMask GSEAL (event_mask);
-
-  guint GSEAL (update_and_descendants_freeze_count);
-
-  GdkWindowRedirect *GSEAL (redirect);
-};
-#endif
-#endif
 
 struct _GdkWindowObjectClass
 {
index ab9e267f0ce8ff3510d47f855ee0bb50f14b4cc7..dac8f1daec7fad20706604493e0a89e6cd33bb66 100644 (file)
  * Boston, MA 02111-1307, USA.
  */
 
-/* need to get the prototypes of all get_type functions */
-#undef GTK_DISABLE_DEPRECATED
-/* Need to get GDK_WINDOW_OBJECT */
-#undef GDK_DISABLE_DEPRECATED
 
 #include "config.h"
 
@@ -92,13 +88,13 @@ test_find_widget_input_windows (GtkWidget *widget,
   GSList *matches = NULL;
   gpointer udata;
   gdk_window_get_user_data (widget->window, &udata);
-  if (udata == widget && (!input_only || (GDK_IS_WINDOW (widget->window) && GDK_WINDOW_OBJECT (widget->window)->input_only)))
+  if (udata == widget && (!input_only || (GDK_IS_WINDOW (widget->window) && gdk_window_is_input_only (GDK_WINDOW (widget->window)))))
     matches = g_slist_prepend (matches, widget->window);
   children = gdk_window_get_children (gtk_widget_get_parent_window (widget));
   for (node = children; node; node = node->next)
     {
       gdk_window_get_user_data (node->data, &udata);
-      if (udata == widget && (!input_only || (GDK_IS_WINDOW (node->data) && GDK_WINDOW_OBJECT (node->data)->input_only)))
+      if (udata == widget && (!input_only || (GDK_IS_WINDOW (node->data) && gdk_window_is_input_only (GDK_WINDOW (node->data)))))
         matches = g_slist_prepend (matches, node->data);
     }
   return g_slist_reverse (matches);
index 24c31546b48274d3283d2a6bb6450fbfa33608f4..457072a8fa6ccffb0a4b91472ec1db8e75f3523d 100644 (file)
@@ -1,4 +1,3 @@
-#undef GDK_DISABLE_DEPRECATED
 #include <gtk/gtk.h>
 #ifdef GDK_WINDOWING_X11
 #include <X11/Xlib.h>
@@ -12,13 +11,6 @@ static void update_store (void);
 
 static GtkWidget *main_window;
 
-static gboolean
-window_has_impl (GdkWindow *window)
-{
-  GdkWindowObject *w;
-  w = (GdkWindowObject *)window;
-  return w->parent == NULL || w->parent->impl != w->impl;
-}
 
 GdkWindow *
 create_window (GdkWindow *parent,
@@ -272,7 +264,7 @@ save_window (GString *s,
   g_string_append_printf (s, "%d,%d %dx%d (%d,%d,%d) %d %d\n",
                          x, y, w, h,
                          color->red, color->green, color->blue,
-                         window_has_impl (window),
+                         gdk_window_has_native (window),
                          g_list_length (gdk_window_peek_children (window)));
 
   save_children (s, window);
@@ -749,6 +741,7 @@ render_window_cell (GtkTreeViewColumn *tree_column,
                    GtkTreeIter       *iter,
                    gpointer           data)
 {
+  GdkColor *color = NULL;
   GdkWindow *window;
   char *name;
 
@@ -757,14 +750,16 @@ render_window_cell (GtkTreeViewColumn *tree_column,
                      0, &window,
                      -1);
 
-  if (window_has_impl (window))
+  if (gdk_window_has_native (window))
       name = g_strdup_printf ("%p (native)", window);
   else
       name = g_strdup_printf ("%p", window);
+
+  gdk_window_get_background (window, color);
   g_object_set (cell,
                "text", name,
-               "background-gdk", &((GdkWindowObject *)window)->bg_color,
-               NULL);  
+               "background-gdk", color,
+               NULL);
 }
 
 static void